using System;
using Datas;
using Mgrs;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

namespace modules.start
{
    /**开始场景 */
    public class StartScene : MonoBehaviour
    {
        public Button btnStart;
        public Button btnContinue;
        public Button btnExit;
        public Button btnSet;
        
        private void Awake()
        {
            btnStart.onClick.AddListener(OnBtnStart);
            btnContinue.onClick.AddListener(OnBtnContinue);
            btnExit.onClick.AddListener(OnBtnExit);
            btnSet.onClick.AddListener(OnBtnSet);
        }

        // Start is called before the first frame update
        void Start()
        {
            
        }

        // Update is called once per frame
        void Update()
        {
            
        }

        public void OnBtnStart()
        {
            PlayerData.InitData();
            ConversationDb.InitData();

            SceneManager.LoadScene("MainScene");
        }
        
        public void OnBtnContinue()
        {
            PlayerData.InitData();
            ConversationDb.InitData();

            SceneManager.LoadScene("MainScene");
        }
        
        public void OnBtnExit()
        {
            Application.Quit();
        }
        
        public void OnBtnSet()
        {
            PanelMgr.OpenSetPanel(transform);
        }
    }
}
